<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form th:action="@{/add}">
<div>
    <table border="1">
        <tr>
            <td colspan="2">增加BUG</td>
        </tr>
        <tr>
            <td>所属项目</td>
            <td><select name="projectid" id="projectid">
                <option value="1">趣买买</option>
                <option value="2">支付宝</option>
                <option value="3">超市</option>
            </select></td>
        </tr>
        <tr>
            <td>严重性</td>
            <td>
                <select name="severity" id="severity">
                    <option value="10">文字错误</option>
                    <option value="20">次要错误</option>
                    <option value="30">严重错误</option>
                </select></td>
        </tr>
        <tr>
            <td>BUG标题(*)</td>
            <td><input type="text" name="title" id="title"><span id="span" style="color: #c657ff"></span></td>
        </tr>
        <tr>
            <td>报告人</td>
            <td><input type="text" name="reportuser" id="reportuser"></td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" value="提交" id="add">
                <input type="button" value="返回" onclick="javascript:history.back()">
            </td>
        </tr>
    </table>
</div>
</form>
</body>
<script type="text/javascript" th:src="@{/webjars/jquery/3.5.1/jquery.js}" ></script>
<script>
    $("#add").click(function () {
        var projectid=$("#projectid").val();
        var severity=$("#severity").val();
        var title=$("#title").val();
        var reportuser=$("#reportuser").val();

        if(title==null||reportuser==null){
            alert("请填写完整信息")
            return false;
        }
    })
</script>
</html>